<template>
  <van-nav-bar :title="title">
    <template #left>
      <van-icon class-prefix="icon" name="shouye" size="25" @click="goHome" />
    </template>
    <template #right>
      <van-icon name="search" size="18" @click="searchPage" />
    </template>
  </van-nav-bar>
</template>

<script lang='ts' setup>
import { useRouter } from 'vue-router';
const router = useRouter()
const goHome = () => {
  router.push({
    path: '/'
  })
}
const searchPage = () => {
  // alert(1)
  router.push({
    path: '/search'
  })
}
</script>

<style lang="scss" scoped>
.van-nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
}
</style>